/**
 * Copyright (c) 2009  Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.jtalk.core;

import it.uniba.di.cdg.jtalk.core.gmail.GMail;
import it.uniba.di.cdg.jtalk.core.gmail.XMPPContainerProvider;

import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.core.IContainerFactory;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;

/**
 * Wiring for the core plugin.
 */
public class CoreConfig extends AbstractModule {

	/* (non-Javadoc)
	 * @see com.google.inject.AbstractModule#configure()
	 */
	@Override
	protected void configure() {
		bind( IContainer.class ).annotatedWith( GMail.class ).toProvider( XMPPContainerProvider.class );
	}
	
	/**
	 * Provide a reference to the ECF container factory.
	 * @return
	 */
	@Provides
	protected IContainerFactory getContainerFactory() {
		return ContainerFactory.getDefault();
	}
}
